package com.yc.util;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

public class CodeGenerator {
    public static void main(String[] args) {
        generate();
    }

    public static void generate(){
        FastAutoGenerator.create("jdbc:mysql:///market", "root", "123456")
                .globalConfig(builder -> builder
                        .author("cxw")
                        .outputDir("E:\\Java项目文件\\schoolmarket\\code")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.yc")
                        .entity("entity")
                        .mapper("mapper")
                        .service("biz")
                        .serviceImpl("biz.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
//                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }

}
